package com.example.demo.http.servlet;

import java.io.IOException;

public abstract class MyServlet {


    public void service(MyRequest request, MyResponse response) throws IOException {
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request, response);
        } else {
            doPost(request, response);
        }
    }

    protected abstract void doGet(MyRequest request, MyResponse response) throws IOException;


    protected abstract void doPost(MyRequest request, MyResponse response) throws IOException;


}
